import { defineStore, storeToRefs } from "pinia"

import { reqHomeBannerApi, reqSortListApi } from "../api/lxcApi"
import type { item } from "../utils/types/lxcTypes"

export const userStore = defineStore("lxc", {
	// id: "homeStore",
	// state: () => ({
	// 	videoCardData: [{} as item],
	// }),
	// getters: {},
	actions: {
		// async getHomeBanner() {
		// 	let res = await reqHomeBannerApi()
		// 	this.videoCardData = res.content
		// },
		// 	async getSortList() {
		// 		let result = await reqSortListApi()
		// 		// console.log(result);
		// 		return result.content
		// 	},
		// 	fixHomeVideoCardData() {
		// 		console.log("aciton执行但是不能改变数据", this.videoCardData)
		// 		this.$patch((state) => {
		// 			state.videoCardData = []
		// 		})
		// 		console.log("aciton执行但是不能改变数据", this.videoCardData)
		// 		this.$patch((state) => {
		// 			state.videoCardData = []
		// 		})
		// 		// let addfive = this.videoCardData.slice(0, 6)
		// 		// let subfive = this.videoCardData.slice(6)
		// 		// console.log("修改之前", this.videoCardData)
		// 		// let newV = subfive.push(...addfive)
		// 		// this.videoCardData = newV
		// 		// console.log("修改之后", this.videoCardData)
		// 		this.videoCardData = []
		// 	},
	},
})
